const path              = require('path')
    , webpack           = require('webpack')
    , HtmlWebpackPlugin = require('html-webpack-plugin')
    ;

module.exports = {
    entry: {
        app: ['./src/css/base.css', './src/js/main.js']
    },
    output: {
        path: path.join(__dirname, 'dist'),
        publicPath: '/',
        filename: '[name]_[hash:8].js'
    },
    module: {
        loaders: [{
            test: /\.vue$/,
            loader: 'vue'
        }, {
            test: /\.js$/,
            loader: 'babel',
            exclude: /node_modules/
        }, {
            test: /\.css/,
            loader: 'style!css',
            exclude: /node_modules/
        }]
    },
    plugins: [
        // html 模版配置
        new HtmlWebpackPlugin({
            filename: 'index.html',
            template: './src/index.html',
            inject: true
        })
    ],
    babel: {
        plugins: [
            'transform-es2015-modules-commonjs'
        ]
    }
};
